package com.wbcs.config.component.other;

public class JavascriptFileBean implements Comparable<JavascriptFileBean>
{
    private String jsfileurl;

    private int loadorder;

    public JavascriptFileBean(String jsfileurl,int loadorder)
    {
        this.jsfileurl=jsfileurl;
        this.loadorder=loadorder;
    }
    
    public String getJsfileurl()
    {
        return jsfileurl;
    }

    public void setJsfileurl(String jsfileurl)
    {
        this.jsfileurl=jsfileurl;
    }

    public int getLoadorder()
    {
        return loadorder;
    }

    public void setLoadorder(int loadorder)
    {
        this.loadorder=loadorder;
    }

    public int compareTo(JavascriptFileBean otherbean)
    {
        if(otherbean==null) return -1;
        if(this.loadorder>otherbean.getLoadorder()) return -1;
        if(this.loadorder<otherbean.getLoadorder()) return 1;
        return 0;
    }

    @Override
	public int hashCode()
    {
        final int prime=31;
        int result=1;
        result=prime*result+((jsfileurl==null)?0:jsfileurl.hashCode());
        result=prime*result+loadorder;
        return result;
    }

    @Override
	public boolean equals(Object obj)
    {
        if(this==obj) return true;
        if(obj==null) return false;
        if(getClass()!=obj.getClass()) return false;
        final JavascriptFileBean other=(JavascriptFileBean)obj;
        if(jsfileurl==null)
        {
            if(other.jsfileurl!=null) return false;
        }else if(!jsfileurl.equals(other.jsfileurl)) return false;
        if(loadorder!=other.loadorder) return false;
        return true;
    }

}
